# $Id$
# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgname=gfbgraph
pkgver=0.2.3+10+gbc03c1f
pkgrel=1
pkgdesc="GLib/GObject wrapper for the Facebook Graph API"
url="https://wiki.gnome.org/Projects/GFBGraph"
arch=(i686 x86_64)
license=(LGPL)
depends=(gnome-online-accounts)
makedepends=(rest json-glib gobject-introspection gtk-doc git)
_commit=bc03c1f8fa59d80b9a12c0a57c26e7a2f852651e  # master
source=("git+https://git.gnome.org/browse/libgfbgraph#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd libgfbgraph
  git describe --tags | sed 's/^v_//;s/_/./g;s/-/+/g'
}

prepare() {
  cd libgfbgraph
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd libgfbgraph
  ./configure --prefix=/usr \
    --disable-static \
    --enable-gtk-doc \
    --enable-introspection
  sed -i -e 's! -shared ! -Wl,--as-needed\0!g' libtool
  make
}

package() {
  cd libgfbgraph
  make DESTDIR="$pkgdir" install \
    libgfbgraphdocdir=/usr/share/doc/$pkgname
}
